using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Web.UI;
using System.Web.UI.WebControls;

using DotNetNuke;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Modules.Actions;
using DotNetNuke.Security;
using DotNetNuke.Services.Exceptions;
using DotNetNuke.Services.Localization;

namespace tm_SearchAdv
{
  
    partial class Viewtm_SearchAdv : PortalModuleBase, IActionable
    {

        #region Private Members

        

        #endregion

        #region Public Methods

        public bool DisplayAudit()
        {
            bool retValue = false;

            if ((string)Settings["auditinfo"] == "Y")
            {
                retValue = true;
            }

            return retValue;
        }

        #endregion

        #region Event Handlers

        
        protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            try
            {
                Tm_SearchAdvProduct.myUserId = UserId;
                Tm_SearchAdvProduct.myPortalId = PortalId;

                Tm_searchAdvEnterprise.myUserId = UserId;
                Tm_searchAdvEnterprise.myPortalId = PortalId;

                Tm_SearchAdvRequest.myUserId = UserId;
                Tm_SearchAdvRequest.myPortalId = PortalId;

                Tm_SearchAdvNews.myUserId = UserId;
                Tm_SearchAdvNews.myPortalId = PortalId;
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }

        }

        

        #endregion

        #region Optional Interfaces

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Registers the module actions required for interfacing with the portal framework
        /// </summary>
        /// <value></value>
        /// <returns></returns>
        /// <remarks></remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public ModuleActionCollection ModuleActions
        {
            get
            {
                ModuleActionCollection Actions = new ModuleActionCollection();
                Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.AddContent, this.LocalResourceFile), ModuleActionType.AddContent, "", "", this.EditUrl(), false, SecurityAccessLevel.Edit, true, false);
                return Actions;
            }
        }

        #endregion

        protected void btnProduct_Click(object sender, EventArgs e)
        {
            Tm_SearchAdvProduct.Visible = true;
            Tm_SearchAdvRequest.Visible = false;
            Tm_searchAdvEnterprise.Visible = false;
            Tm_SearchAdvNews.Visible = false;
        }
        protected void btnRequest_Click(object sender, EventArgs e)
        {
            Tm_SearchAdvProduct.Visible = false;
            Tm_SearchAdvRequest.Visible = true;
            Tm_searchAdvEnterprise.Visible = false;
            Tm_SearchAdvNews.Visible = false;
        }
        protected void btnEnterprise_Click(object sender, EventArgs e)
        {
            Tm_SearchAdvProduct.Visible = false;
            Tm_SearchAdvRequest.Visible = false;
            Tm_searchAdvEnterprise.Visible = true;
            Tm_SearchAdvNews.Visible = false;
        }
        protected void btnNew_Click(object sender, EventArgs e)
        {
            Tm_SearchAdvProduct.Visible = false;
            Tm_SearchAdvRequest.Visible = false;
            Tm_searchAdvEnterprise.Visible = false;
            Tm_SearchAdvNews.Visible = true;
        }
}
}

